package com.manor.main.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.manor.main.interfaces.BaseFragmentInterface;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class BaseFragment extends Fragment implements BaseFragmentInterface {
    protected LayoutInflater mInflater;
    protected ViewGroup mActionBar;
    private String mActionBarTitle;
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        LinearLayout layout = new LinearLayout(getActivity());
        View view;
        layout.setOrientation(LinearLayout.VERTICAL);

        view = LayoutInflater.from(getActivity()).inflate(getLayoutId(), null);
        layout.addView(view);
        initData();
        initView(layout);
        return layout;
    }

    private boolean hasBackButton() {
        return false;
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    protected int getLayoutId() {
        return 0;
    }

    protected View inflateView(int resId) {
        return this.mInflater.inflate(resId, null);
    }

    public boolean onBackPressed() {
        return false;
    }




    protected String getActionBarTitle() {
        return mActionBarTitle;
    }




    @Override
    public void initView(View view) {

    }

    @Override
    public void initData() {

    }
}
